package response

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

type Response struct {
	Code    int         `json:"code" example:"200"`
	Message string      `json:"message" example:"success"`
	Data    interface{} `json:"data"`
}

func Success(ctx *gin.Context, data interface{}) {
	response := Response{
		Code:    http.StatusOK,
		Message: "success",
		Data:    data,
	}
	ctx.JSON(http.StatusOK, response)
}
